from PIL import Image, ImageFilter, ImageEnhance

with Image.open("original.jpg") as pic_original:
    print("Изображение открыто")
    print("Размер:", pic_original.size)
    print("Формат:", pic_original.format)
    print("Тип:", pic_original.mode)
    pic_original.show()

    pic_gray = pic_original.convert('L')
    print("Изображение создано")
    print("Размер:", pic_gray.size)
    print("Формат:", pic_gray.format)
    print("Тип:", pic_gray.mode)
    pic_gray.show()
    pic_gray.save('gray.jpg')

    pic_blur = pic_original.filter(ImageFilter.BLUR)
    pic_blur.save("blur.jpg")
    pic_blur.show()

    pic_up = pic_original.transpose(Image.ROTATE_180)
    pic_up.save("up.jpg")
    pic_up.show()

    pic_mirror = pic_original.transpose(Image.FLIP_LEFT_RIGHT)
    pic_mirror.save('mirror.jpg')
    pic_mirror.show()

    pic_contrast = ImageEnhance.Contrast(pic_original)
    pic_contrast = pic_contrast.enhance(1.5)
    pic_contrast.save('contr.jpg')
    pic_contrast.show()

